package com.telit.firecommand.service.impl;

import com.telit.firecommand.dao.CommFireLossDao;
import com.telit.firecommand.entity.CommFireLoss;
import com.telit.firecommand.service.CommFireLossService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 * @author zhouyu
 * @description 灾损统计实现类
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class CommFireLossServiceimpl implements CommFireLossService {

    @Autowired
    private CommFireLossDao commFireLossDao;


    @Override
    @Transactional
    public void add(CommFireLoss commFireLoss) {
        commFireLossDao.deleteByFireId(commFireLoss.getFireId());
        commFireLossDao.insert(commFireLoss);
    }

    @Override
    public CommFireLoss queryByFireId(Long fireId) {
        return commFireLossDao.queryByFireId(fireId);
    }
}
